package com.afc.struts.form.generator;

import java.util.Collection;
import java.util.List;
import java.util.Vector;

import com.afc.struts.annotations.PossibleValues;
import com.afc.struts.form.ActionForm;
import com.afc.struts.form.generator.Api.DefaultApi;
import com.afc.struts.utils.LabeledBoolean;

public class FormGeneratorUtils
{
  static public final String ACTION_FORM_CLASS_NAME = AsmUtils.fromHighLevelClassName(ActionForm.class.getName());
  static public final String ACTION_FORM_REFERENCE_NAME = AsmUtils.getReferenceName(ACTION_FORM_CLASS_NAME);

  static public final String LABELED_BOOLEAN_CLASS_NAME = AsmUtils.fromHighLevelClassName(LabeledBoolean.class.getName());
  static public final String LABELED_BOOLEAN_REFERENCE_NAME = AsmUtils.getReferenceName(LABELED_BOOLEAN_CLASS_NAME);

  static public final String VECTOR_CLASS_NAME = AsmUtils.fromHighLevelClassName(Vector.class.getName());
  static public final String VECTOR_REFERENCE_NAME = AsmUtils.getReferenceName(VECTOR_CLASS_NAME);

  static public final String LIST_CLASS_NAME = AsmUtils.fromHighLevelClassName(List.class.getName());
  static public final String LIST_REFERENCE_NAME = AsmUtils.getReferenceName(LIST_CLASS_NAME);

  static public final String COLLECTION_CLASS_NAME = AsmUtils.fromHighLevelClassName(Collection.class.getName());
  static public final String COLLECTION_REFERENCE_NAME = AsmUtils.getReferenceName(COLLECTION_CLASS_NAME);

  static public final String POSSIBLE_VALUES_CLASS_NAME = AsmUtils.fromHighLevelClassName(PossibleValues.class.getName());
  static public final String POSSIBLE_VALUES_REFERENCE_NAME = AsmUtils.getReferenceName(POSSIBLE_VALUES_CLASS_NAME);

  // ActionForm
  static public final Api ACTION_FORM_VALIDATE_API = new DefaultApi("validateForm", "()" + LABELED_BOOLEAN_REFERENCE_NAME);

  // Collection
  static public final Api COLLECTION_ADD_API = new DefaultApi("add", "(" + AsmUtils.OBJECT_REFERENCE_NAME + ")" + TypeDescription.BOOLEAN);
}
